<template>
    <particles v-bind:style="{backgroundImage: 'url('+require('../../assets/images/13-1.jpg')+')'}">
        <div class="container-fluid display-flex h-100d">
            <slot></slot>
            <footer-tip></footer-tip>
        </div>
    </particles>
</template>

<style>
    #particles-js {
        position: absolute;
        width: 100%;
        height: 100%;
        background-repeat: no-repeat;
        background-size: cover;
        background-position: center center;
    }

    #particles-js canvas {
        position: absolute;
        z-index: 1;
    }
</style>

<script>
    /* eslint-disable no-undef */
    import FooterTip from '../layout/FooterTip.vue';
    import Particles from '../layout/Particles.vue';

    export default {
        name: 'SigMain',
        data () {
            return {};
        },
        components: {
            Particles,
            FooterTip
        },
        methods: {
            login (email, password) {
                console.info(email, password);
                axios.post('login', {email: email, password: password}).then((res) => {
                    if (res.data.success === false) {
                        this.$notify.open({
                            fixed: 'top-right',
                            timeout: 10000,
                            content: '登录失败, 请检查你的email和密码',
                            type: 'warning'
                        });
                    } else {
                        storage.set(this.$key.TOKEN_KEY, res.data.data.token);
                        this.$router.push({name: 'DashBoard'});
                    }
                });
            }
        }
    };
</script>
